/*
 * Copyright (C) 2015 CK, Inc. All Rights Reserved.
 */

package cn.vansky.auth.dao.impl.user;

import cn.vansky.auth.bo.user.User;
import cn.vansky.auth.dao.user.UserDao;
import cn.vansky.auth.dao.user.UserMapper;
import cn.vansky.auth.dto.user.UserDto;
import cn.vansky.framework.core.dao.ConfigurableBaseSqlMapDao;
import cn.vansky.framework.core.dao.DaoMapper;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * This class was generated by MyBatis Generator.
 * This class corresponds to the database table tb_user
 *
 * @mbggenerated 2015-09-05 14:06:23
 */
@Repository("userDao")
public class UserDaoImpl extends ConfigurableBaseSqlMapDao<User, Integer> implements UserDao {
    @Autowired
    private UserMapper userMapper;

    @Override
    public DaoMapper<User, Integer> getDaoMapper() {
        return userMapper;
    }

    @Resource(name = "sqlSessionFactory")
    @Override
    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
        setSqlSessionFactoryInternal(sqlSessionFactory);
    }

    @Override
    public List<UserDto> findPageList(Map<String, Object> params) {
        return userMapper.findPageList(params);
    }

    @Override
    public User findUserByMap(User user) {
        return userMapper.findUserByMap(user);
    }
}